Analysis of Imperative Programs through Analysis of Constraint Logic Programs
نویسندگان
چکیده
In this paper a method is proposed for carrying out analysis of imperative programs. We achieve this by writing down the language semantics as a declarative program (a constraint logic program, in the approach shown here). We propose an e ective style of writing operational semantics suitable for analysis which we call one-state small-step semantics. Through controlled partial evaluation we are able to generate residual programs where the relationship between imperative statements and predicates is straightforward. Then we use a static analyser for constraint logic programs on the residual program. The analysis results are interpreted through program points associating predicates in the partially evaluated interpreter to statements in its corresponding imperative program. We used an analyser that allows us to determine linear equality, inequality and disequality relations among the variables of a program without user-provided inductive assertions or human interaction. The proposed method intends to serve as a framework for the analysis of programs in any imperative language. The tools required are a partial evaluator and a static analyser for the declarative language.
منابع مشابه
Slicing of Constraint Logic Programs
Abstract. Slicing is a program analysis technique originally developed for imperative languages. It facilitates understanding of data flow and debugging. This paper discusses slicing of Constraint Logic Programs. Constraint Logic Programming (CLP) is an emerging software technology with a growing number of applications. Data flow in constraint programs is not explicit, and for this reason the c...
متن کاملLearning of Constraint Logic Programs by Combining Unfolding and Slicing Techniques
This paper discusses learning of Constraint Logic Programs using unfolding and slicing technique. The transformation rule for unfolding together with clause removal is a method for specialization of Logic Programs. Slicing is a program analysis technique originally developed for imperative languages. It facilitates the understanding of data flow and debugging. This paper formulates the semantic...
متن کاملOptimizing Compilation of Linear
A central issue in the optimizing compilation of Constraint Logic Programming (CLP) languages is how to compile away as much general constraint solving as possible. Most such work relies on obtaining mode and type information by global analysis, and uses it to generate specialized code for individual constraints and calls, often with the aid of multiple specialization. Some recent work has augm...
متن کاملExperiments with Non-Termination Analysis for Java Bytecode
Non-termination analysis proves that programs, or parts of a program, do not terminate. This is important since non-termination is often an unexpected behaviour of computer programs and exposes a bug in their code. While research has found ways of proving non-termination of logic programs and of term rewriting systems, this is hardly the case for imperative programs. In this paper, we describe ...
متن کاملAutomatic Complexity Analysis of Logic Programs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 12 CHAPTER 1: INTRODUCTION .. 1.1 Complexity Analysis of Programs ... 1.2 Automatic Complexity Analysis of Programs 1.2.1 Imperative Programs . 1.2.2 Functional Programs . 1.2.3 Logic Programs . . . . . 1.3 Applications of Automatic Complexity Analysis. 1.4 Contributions .......... . 1.5 Organization of the Dissertatio...
متن کامل